package cn.edu.zafu.bigdata.hzq;

public class Text4 {
    public static void main(String[] args) {
        // 定义一个 Vehicle 数组，存储 Car 和 Bicycle 对象
        Vehicle[] vehicles = new Vehicle[2];
        vehicles[0] = new Car();
        vehicles[1] = new Bicycle();

        // 调用它们的 move() 方法，展示多态性
        for (Vehicle vehicle : vehicles) {
            vehicle.move();
        }
    }
}
